package cn.zhuama.basic.listener;

import cn.zhuama.system.service.IPermissionScanService;
import cn.zhuama.system.service.IPermissionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@Slf4j
@WebListener//申明自定义的web监听器，被容器注册和使用
public class PermissionListener implements ServletContextListener {
    @Autowired
    IPermissionScanService iPermissionScanService;
    @Override
    public void contextInitialized(ServletContextEvent sce) {
        iPermissionScanService.scanPermission();
    }
}
